package ysq.xyg.shop.model.po;

import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 商城模块-轮播图实体类
 *
 * @author congcong tao
 * @date 2019-4-28 9:06:40
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_shop_banner")
public class ShopBanner implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	
	/**
     * 类型1、banner图用
     */ 
	@Column(name = "type")
	private String type;
	
	/**
     * 名称
     */ 
	@Column(name = "title")
	private String title;
	
	/**
     * 图片
     */ 
	@Column(name = "image")
	private String image;
	
	/**
     * 排序
     */ 
	@Column(name = "order_num")
	private String orderNum;
	
	/**
     * 有效状态1、有效2、无效
     */ 
	@Column(name = "status")
	private String status;
	
	/**
     * 跳转链接
     */ 
	@Column(name = "url")
	private String url;
	
	/**
     * 创建者
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;
	
	/**
     * 删除状态1、未删除2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 更新者
     */ 
	@Column(name = "update_user")
	private String updateUser;
	
	/**
     * 更新时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;
	

	public ShopBanner(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}